package test;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Arrays;

public class ReadIco {

	public static void main(String[] args) throws Exception {
		File f = new File("D:\\workSrc\\aatStart\\src\\test\\java\\test\\favicon.ico");
		InputStream in = new FileInputStream(f);
		byte[] buf = new byte[1024];
		int i = -1;
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		while((i = in.read(buf)) > -1 ) {
			bos.write(buf, 0, i);
		}
		byte[] res = bos.toByteArray();
		System.out.println(Arrays.toString(res));
		bos.close();
		in.close();
	}

}
